package com.sunnada.edu.business.salaryManage.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sunnada.edu.system.pub.dao.BaseDaoImpl;


@Repository
public class RewardDaoImpl extends BaseDaoImpl implements RewardDao {

	@Override
	public int getWorkerCots(HashMap<String, String> params) {
		List list = selectList("reward_sqlmap.getWorkerCots", params);
		if(list!=null&&list.size()>0){
			String cot = ((Map)list.get(0)).get("COT")+"";
			return Integer.valueOf(cot);
		}
		return 0;
	}

	@Override
	public List<?> findWorkers(HashMap<String, String> params) {
		return selectList("reward_sqlmap.findWorkers", params);
	}

	@Override
	public int rewardDel(HashMap<String, String> params) {
		return delete("reward_sqlmap.rewardDel", params);
	}

	@Override
	public int rewardAdd(HashMap<String, String> params) {
		return insert("reward_sqlmap.rewardAdd",params);
	}

	@Override
	public int rewardUpdate(HashMap<String, String> params) {
		return update("reward_sqlmap.rewardUpdate",params);
	}

	@Override
	public Map getRewardByRecId(HashMap<String, String> params) {
		List list = selectList("reward_sqlmap.getRewardByRecId", params);
		if(list!=null&&list.size()>0){
			return (Map)list.get(0);
		}
		return null;
	}

	@Override
	public List<HashMap<String, String>> judgeRewardUnique(
			HashMap<String, String> params) {
		return selectList("reward_sqlmap.judgeRewardUnique", params);
	}

	@Override
	public List<?> getRewardType(HashMap<String, String> params) {
		return selectList("reward_sqlmap.getRewardType", params);
	}

	@Override
	public List<?> getRewardLevel(HashMap<String, String> params) {
		return selectList("reward_sqlmap.getRewardLevel", params);
	}

	@Override
	public List<?> getRewardApplyByRecid(HashMap<String, String> params) {
		return selectList("reward_sqlmap.getRewardApplyByRecid", params);
	}

	@Override
	public List<?> getProcessConditionByrecid(HashMap<String, String> params) {
		return selectList("reward_sqlmap.getProcessConditionByrecid", params);
	}

	@Override
	public int getProjectCots(HashMap<String, String> params) {
		List list = selectList("reward_sqlmap.getProjectCots", params);
		if(list!=null&&list.size()>0){
			String cot = ((Map)list.get(0)).get("COT")+"";
			return Integer.valueOf(cot);
		}
		return 0;
	}

	@Override
	public List<?> findProjects(HashMap<String, String> params) {
		return selectList("reward_sqlmap.findProjects", params);
	}

}
